
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>
    <button class="jian">减</button>
    <input type="text" class="inp" value=1>
    <button class="jia">加</button>
</body>
<script>
    var jian = document.querySelector('.jian')
    var jia = document.querySelector('.jia')
    var inp = document.querySelector('.inp')

    jia.onclick = function(){
        jian.disabled = ''
        var inpval = inp.value
        inpval++
        inp.value = inpval
    }

    jian.onclick = function(){
        var inpval = inp.value
        inpval--
        inp.value = inpval
        if(inpval==1){
            jian.disabled= "disabled"
            return;
        }
    }
</script>
</html>